#include <jni.h>
#include <GLES3/gl3.h>
//
// Created by Administrator on 2023-03-11.
//


extern "C"
JNIEXPORT void JNICALL
Java_com_itfitness_opengl_MyRender_ndkSurfaceCreated(JNIEnv *env, jobject thiz) {
    //清空颜色（以红色进行清空）
    glClearColor(1.0,0,0,1.0);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_itfitness_opengl_MyRender_ndkSurfaceChanged(JNIEnv *env, jobject thiz, jint width,
                                                     jint height) {
    //设置窗口大小
    glViewport(0,0,width,height);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_itfitness_opengl_MyRender_ndkDrawFrame(JNIEnv *env, jobject thiz) {
    //清空颜色缓冲区或深度缓冲区
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}